-
Notifications
You must be signed in to change notification settings - Fork 143
Docs: Improve local setup instructions for API keys & .env file structure #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Docs: Improve local setup instructions for API keys & .env file structure #215
Conversation
📝 WalkthroughWalkthroughUpdates README and Changes
Sequence Diagram(s)(omitted — changes are documentation/config updates and do not introduce new multi-component control flow requiring sequence diagrams) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md(3 hunks)
🔇 Additional comments (7)
README.md (7)
1-222: Verify PR scope completeness against issue #178 objectives.Issue #178 lists several requirements for improved local setup documentation:
✅ Addressed:
- Gemini API key retrieval steps (lines 168–175)
.envfile structure example (lines 177–209)❌ Missing or incomplete:
- YouTube API key retrieval steps (mentioned in issue but not in this PR)
- Python virtual environment (venv) setup instructions (explicit commands for creating and activating venv are absent)
- Backend
.env.examplefile update (only README is updated; the actual.env.examplefile is not shown)- Supabase password/host retrieval guidance is provided as a connection string but could be clearer on where to find the project password in the Supabase dashboard
Please clarify whether this PR intentionally defers some requirements to a follow-up PR, or if these items were inadvertently omitted.
1-222: Verify PR scope completeness against issue #178 stated objectives.Issue #178 lists several setup documentation improvements. This PR addresses some but not all:
✅ Addressed:
- Gemini API key retrieval steps (lines 168–175)
- Final
.envfile structure example (lines 177–209)❌ Missing or incomplete:
- YouTube API key retrieval steps (listed in issue #178 but not in this PR)
- Python virtual environment (venv) setup instructions with explicit commands
- Backend
.env.examplefile update (only README shown;.env.examplefile changes not included)- Supabase credential retrieval guidance could be clearer on where to locate the project password in the Supabase dashboard
Clarify whether these omissions are intentional (phased approach) or unintentional oversights.
128-131: Fix incorrect backend directory path.Line 130 uses
cd backend/appfrom a location already inside thebackenddirectory (line 119). This creates an incorrect path. Either navigate tocd app(if the app subdirectory exists) or remove this step ifmain.pyis at thebackend/root level.
177-209: Verify .env database credentials format against backend configuration.The
.envexamples list database connection parameters (user,password,host,port,dbname) without a consistent naming pattern. While these are technically validkey=valuepairs, confirm that the backend code actually reads them in this format. Most FastAPI/SQLAlchemy applications expect either:
- A single
DATABASE_URLvariable with full connection string, or- Prefixed environment variables like
DATABASE_USER,DATABASE_PASSWORD, etc.If the backend uses a different format, update the examples accordingly.
219-221: Verify backend startup command against actual directory structure.The startup command
uvicorn main:app --reloadassumesmain.pyis at thebackend/root level. However, ifmain.pyis located inbackend/app/(as suggested by line 130's navigation), the correct command should beuvicorn app.main:app --reload.Once the directory structure issue in lines 128–131 is resolved, update this command accordingly.
177-209: Verify backend's environment variable parsing for database credentials.The
.envexamples in the README list database parameters (user,password,host,port,dbname) in bare format. Confirm whether the backend code actually expects this format or if it requiresDATABASE_URLor individually prefixed variables (e.g.,DATABASE_USER,DATABASE_PASSWORD). Check the database connection initialization code to ensure the README documentation matches the actual implementation.
128-131: Verify backend directory structure and README.md navigation path.The navigation path at line 130 (
cd backend/app) requires confirmation against the actual repository structure. Determine whetherapp/is a subdirectory ofbackend/containingmain.py, or ifmain.pyresides at thebackend/root level, then adjust the documented command accordingly.
README.md
Outdated
| 7. Get the Gemini API key: | ||
| - Visit [Google AI Studio](https://aistudio.google.com/) | ||
| - SignIn/SignUp with Google account | ||
| - Click "API Keys" left side panel | ||
| - Click "Create API Key" | ||
| - Name your key "..." and select "Default Gemini Project" | ||
| - Click "Create key" | ||
| - Paste the API KEy into the `.env` file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Google AI Studio create API key current instructions 2025
💡 Result:
Steps (current, 2025)
- Sign in to Google AI Studio (ai.google.dev / aistudio). [1]
- If you don’t have a Cloud project in AI Studio: Dashboard → Projects → Import projects (or create a new Google Cloud project in Cloud Console). [1]
- In AI Studio Dashboard open API Keys → Create API key → choose the Google Cloud project to attach the key to → confirm. Copy the generated key. [1]
- Use the key securely (set as GEMINI_API_KEY or GOOGLE_API_KEY environment variable for clients; or provide explicitly for REST/browser use). [1][3]
- If AI Studio can’t create a project/key (permission error), create the key directly in Google Cloud Console: Cloud Console → APIs & Services → Credentials → Create credentials → API key, then use that key in AI Studio or your app. Ensure your account has apikeys.keys.create, resourcemanager.projects.update and serviceusage.services.enable if you want AI Studio to create keys for you. [2]
Sources:
[1] Google AI for Developers — Using Gemini API keys / AI Studio docs.
[2] Google AI Studio community support + GCP Console instructions.
[3] Google AI for Developers — Build mode / key usage recommendations.
Fix typo and update Gemini API key steps to match current UI.
Line 175 contains a typo: "Paste the API KEy" should be "Paste the API Key".
The documented steps are outdated. Current Google AI Studio interface (2025) differs from the substeps listed:
- API Keys is accessed via Dashboard → API Keys, not a left side panel
- The UI no longer uses "Default Gemini Project" terminology
- Users must first create or import a Google Cloud project before generating API keys
- The key naming step described does not match the current flow
Update the instructions to reflect: Sign in to ai.google.dev, navigate to Dashboard → API Keys → Create API key, select/create a Google Cloud project, then copy the generated key for use in the .env file.
🤖 Prompt for AI Agents
In README.md around lines 168 to 175, fix the typo ("Paste the API KEy" → "Paste
the API Key") and update the Gemini API key setup steps to match the 2025 Google
AI Studio flow: instruct users to sign in at ai.google.dev (or Google AI
Studio), navigate to Dashboard → API Keys → Create API key, ensure they select
or create/import the appropriate Google Cloud project when prompted, then copy
the generated API key and paste it into the .env file; replace references to
"left side panel" and "Default Gemini Project" with the updated navigation and
project selection instructions.
🧩 Analysis chain
🌐 Web query:
Google AI Studio API key creation steps 2025 current interface
💡 Result:
Steps (current AI Studio flow, 2025):
- Sign in to Google AI Studio (ai.google.com/studio) and open the Dashboard. [1]
- Import the Google Cloud project you want to use: Dashboard → Projects → Import projects → search/select your project → Import. (AI Studio only shows imported projects.) [1]
- After import, open Dashboard → API Keys (or “API Keys” in the left menu) and click Create API key. Choose the imported GCP project to associate the key; copy the key when shown. [1]
- (If AI Studio cannot create a key) Create an API key directly in Google Cloud Console: Cloud Console → Menu → APIs & Services → Credentials → Create credentials → API key. Then restrict the key and enable required APIs (e.g., Generative Language/Gemini). [2][3]
- Set the key locally as GEMINI_API_KEY or GOOGLE_API_KEY (server-side preferred) and follow Google’s best practices for key restrictions and security. [1]
Notes: Creating keys from AI Studio requires IAM permissions such as apikeys.keys.create, serviceusage.services.enable and resourcemanager.projects.update; if you lack permissions, use the Cloud Console or ask your admin. [1][3]
Sources: Google AI Studio “Using Gemini API keys” tutorial and Google Cloud API Keys docs. [1][2][3]
Fix typo and update Gemini API key creation steps to match current Google AI Studio interface.
Line 175: "API KEy" should be "API Key".
The steps in lines 168-175 are incomplete and don't match the current Google AI Studio workflow (2025). The current process requires:
- Importing a Google Cloud project into AI Studio first (Dashboard → Projects → Import projects)
- Creating the API key after import (Dashboard → API Keys or left menu → Create API key)
- Associating the key with the imported GCP project
The README skips the project import step entirely, which may cause users to fail if they attempt to follow these steps. Additionally, the URL should reference ai.google.com/studio instead of aistudio.google.com.
Consider updating the steps to include project import and clarifying the association with GCP projects.
🤖 Prompt for AI Agents
In README.md around lines 168 to 175, fix the typo "API KEy" → "API Key", update
the URL to https://ai.google.com/studio, and replace the current Gemini API key
steps with the current workflow: first import your Google Cloud project into AI
Studio (Dashboard → Projects → Import projects), then navigate to Dashboard →
API Keys (or left menu → Create API key) to create a key, ensure you
associate/choose the imported GCP project when creating the key, and finally
paste the generated API Key into your .env file.
…etup steps with remaining setup instructions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Backend/.env-example(1 hunks)README.md(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
🔇 Additional comments (1)
Backend/.env-example (1)
4-6: LGTM!The Supabase connection pooler format is correct. The
postgres.<project>user format andaws-<location>.pooler.supabase.comhost format align with Supabase's connection string requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In @README.md:
- Line 184: Fix the typo "Serach" in the README at the occurrence that reads
'Serach "YouTube Data API v3"' by replacing it with "Search" so the line reads
'Search "YouTube Data API v3"'; update the README.md accordingly.
- Around line 179-180: Replace the incorrect link text "Visit [Groq Console]" in
step 9 with the correct label "Visit Google Cloud Console" (or change the
bracketed text to "[Google Cloud Console]") so the link target
(https://console.cloud.google.com/) matches its visible text; ensure the change
is applied to the step that begins "Get the YouTube API key:" so it is
consistent with step 8.
- Around line 199-231: The final .env examples in README.md are missing
YOUTUBE_API_KEY and use vague [URL] placeholders; update both IPv6 and IPv4
example blocks to include a YOUTUBE_API_KEY entry (e.g.,
YOUTUBE_API_KEY=[YOUR-YOUTUBE-API-KEY]) and replace SUPABASE_KEY, GROQ_API_KEY,
and GEMINI_API_KEY placeholders with descriptive tokens like
[YOUR-SUPABASE-KEY], [YOUR-GROQ-API-KEY], [YOUR-GEMINI-API-KEY] to match
Backend/.env-example and make the intent clear.
- Around line 127-130: The README currently shows only the Windows-specific
virtual environment activation command (venv\Scripts\activate); update the venv
activation section to include cross-platform instructions by keeping the
existing Windows command and adding macOS/Linux activation using source
venv/bin/activate (and optionally the PowerShell/Mac zsh variants if desired) so
users on Windows, macOS, and Linux can follow the correct command.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Backend/.env-exampleREADME.md
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-08T12:24:11.598Z
Learnt from: Saahi30
Repo: AOSSIE-Org/InPactAI PR: 145
File: backend/SQL:98-112
Timestamp: 2025-11-08T12:24:11.598Z
Learning: In the InPactAI repository, the backend/SQL file is a documentation reference that points to schema-reference.md and is not meant to be executed directly. Table ordering and FK constraint issues should not be flagged for this file.
Applied to files:
README.md
📚 Learning: 2025-07-14T11:45:01.864Z
Learnt from: Saahi30
Repo: AOSSIE-Org/InPactAI PR: 98
File: Frontend/src/pages/CollaborationDetails.tsx:234-234
Timestamp: 2025-07-14T11:45:01.864Z
Learning: In frontend-only PRs, hardcoded URLs (like dummy PDF URLs for contracts) and mock data are acceptable and intentional placeholders for UI development, to be replaced during backend integration phase.
Applied to files:
Backend/.env-example
🪛 markdownlint-cli2 (0.18.1)
README.md
191-191: Unordered list indentation
Expected: 0; Actual: 3
(MD007, ul-indent)
192-192: Unordered list indentation
Expected: 0; Actual: 3
(MD007, ul-indent)
193-193: Unordered list indentation
Expected: 0; Actual: 3
(MD007, ul-indent)
194-194: Unordered list indentation
Expected: 0; Actual: 3
(MD007, ul-indent)
195-195: Unordered list indentation
Expected: 0; Actual: 3
(MD007, ul-indent)
196-196: Unordered list indentation
Expected: 0; Actual: 3
(MD007, ul-indent)
197-197: Unordered list indentation
Expected: 0; Actual: 3
(MD007, ul-indent)
🔇 Additional comments (3)
Backend/.env-example (1)
1-14: LGTM!The
.env-examplefile is well-structured with clear placeholder naming conventions ([YOUR-*]) for all required environment variables. This covers all the credentials mentioned in issue #178: Supabase configuration, database connection details, and all three API keys (GROQ, GEMINI, YOUTUBE).README.md (2)
87-88: LGTM!Repository URL and directory name correctly updated to
InPactAI.
241-243: LGTM!The uvicorn command correctly references
app.main:appto run from the backend directory.
| 3. Activate the virtual environment | ||
| ```sh | ||
| venv\Scripts\activate | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add cross-platform venv activation instructions.
The activation command is Windows-specific. Issue #178 explicitly requested instructions for Windows/macOS/Linux.
📝 Suggested fix
3. Activate the virtual environment
+
+ **Windows:**
```sh
venv\Scripts\activate- macOS/Linux:
+sh +source venv/bin/activate +
</details>
<!-- suggestion_start -->
<details>
<summary>📝 Committable suggestion</summary>
> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
```suggestion
3. Activate the virtual environment
**Windows:**
🤖 Prompt for AI Agents
In @README.md around lines 127 - 130, The README currently shows only the
Windows-specific virtual environment activation command (venv\Scripts\activate);
update the venv activation section to include cross-platform instructions by
keeping the existing Windows command and adding macOS/Linux activation using
source venv/bin/activate (and optionally the PowerShell/Mac zsh variants if
desired) so users on Windows, macOS, and Linux can follow the correct command.
| 9. Get the YouTube API key: | ||
| - Visit [Groq Console](https://console.cloud.google.com/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix incorrect link text.
Line 180 says "Visit [Groq Console]" but links to Google Cloud Console. This appears to be a copy-paste error from step 8.
📝 Suggested fix
9. Get the YouTube API key:
- - Visit [Groq Console](https://console.cloud.google.com/)
+ - Visit [Google Cloud Console](https://console.cloud.google.com/)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 9. Get the YouTube API key: | |
| - Visit [Groq Console](https://console.cloud.google.com/) | |
| 9. Get the YouTube API key: | |
| - Visit [Google Cloud Console](https://console.cloud.google.com/) |
🤖 Prompt for AI Agents
In @README.md around lines 179 - 180, Replace the incorrect link text "Visit
[Groq Console]" in step 9 with the correct label "Visit Google Cloud Console"
(or change the bracketed text to "[Google Cloud Console]") so the link target
(https://console.cloud.google.com/) matches its visible text; ensure the change
is applied to the step that begins "Get the YouTube API key:" so it is
consistent with step 8.
| - Sign in with your Google Account | ||
| - Select "Default Project" or Create "New Project", Look at the top | ||
| - In sidebar go to "APIs & Services" then click "Library" | ||
| - Serach "YouTube Data API v3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "Serach" → "Search".
📝 Suggested fix
- - Serach "YouTube Data API v3"
+ - Search "YouTube Data API v3"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - Serach "YouTube Data API v3" | |
| - Search "YouTube Data API v3" |
🤖 Prompt for AI Agents
In @README.md at line 184, Fix the typo "Serach" in the README at the occurrence
that reads 'Serach "YouTube Data API v3"' by replacing it with "Search" so the
line reads 'Search "YouTube Data API v3"'; update the README.md accordingly.
| 11. Final `.env` file should look: | ||
| ```sh | ||
| SUPABASE_URL=[URL] | ||
| SUPABASE_KEY=[URL] | ||
| user=postgres | ||
| password=[YOUR-PASSWORD] | ||
| host=db.wveftanaurduixkyijhf.supabase.co | ||
| port=5432 | ||
| dbname=postgres | ||
| GROQ_API_KEY=[URL] | ||
| GEMINI_API_KEY=[URL] | ||
| ``` | ||
| [The above works in ipv6 networks, if you are in ipv4 network or it cause errors, use the below connection string which could be found in Session Pooler connection] | ||
| ```sh | ||
| SUPABASE_URL=[URL] | ||
| SUPABASE_KEY=[URL] | ||
| user=postgres.<project> | ||
| password=[YOUR-PASSWORD] | ||
| host=aws-<location>.pooler.supabase.com | ||
| port=5432 | ||
| dbname=postgres | ||
| GROQ_API_KEY=[URL] | ||
| GEMINI_API_KEY=[URL] | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final .env examples are missing YOUTUBE_API_KEY.
Step 9 documents obtaining the YouTube API key, and Backend/.env-example includes YOUTUBE_API_KEY, but both final .env examples here omit it. Additionally, consider using more descriptive placeholders like [YOUR-GROQ-API-KEY] instead of [URL] for API keys (consistent with .env-example).
📝 Suggested fix (showing IPv6 block; apply same to IPv4 block)
```sh
SUPABASE_URL=[URL]
- SUPABASE_KEY=[URL]
+ SUPABASE_KEY=[YOUR-SUPABASE-KEY]
user=postgres
password=[YOUR-PASSWORD]
host=db.wveftanaurduixkyijhf.supabase.co
port=5432
dbname=postgres
- GROQ_API_KEY=[URL]
+ GROQ_API_KEY=[YOUR-GROQ-API-KEY]
- GEMINI_API_KEY=[URL]
+ GEMINI_API_KEY=[YOUR-GEMINI-API-KEY]
+
+ YOUTUBE_API_KEY=[YOUR-YOUTUBE-API-KEY]
```🤖 Prompt for AI Agents
In @README.md around lines 199 - 231, The final .env examples in README.md are
missing YOUTUBE_API_KEY and use vague [URL] placeholders; update both IPv6 and
IPv4 example blocks to include a YOUTUBE_API_KEY entry (e.g.,
YOUTUBE_API_KEY=[YOUR-YOUTUBE-API-KEY]) and replace SUPABASE_KEY, GROQ_API_KEY,
and GEMINI_API_KEY placeholders with descriptive tokens like
[YOUR-SUPABASE-KEY], [YOUR-GROQ-API-KEY], [YOUR-GEMINI-API-KEY] to match
Backend/.env-example and make the intent clear.
Closes #178
📝 Description
This PR fixes the README backend setup instructions by:
🔧 Changes Made
✅ Checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.